import Vue from 'vue'
 
export default (component, props) => {
  const conCtor = Vue.extend(component)
 
  const el = new conCtor({propsData: props}).$mount()
 
  document.body.appendChild(el.$el)
 
  conCtor.remove = () => {
    document.body.removeChild(el.$el)
    conCtor.$destroy()
  }
 
  return el
}